﻿using System;
using System.Configuration;

namespace SimpleHttpServer
{
    public static class Settings
    {
        public static int Port
        {
            get
            {
                string sPort = ConfigurationManager.AppSettings["port"];

                int port = int.Parse(sPort);

                return port;
            }
        }

        public static PersistanceMode PersistanceMode
        {
            get
            {
                string pers = ConfigurationManager.AppSettings["persistance_mode"];

                PersistanceMode mode = (PersistanceMode) Enum.Parse(typeof (PersistanceMode), pers, true);

                return mode;
            }
        }
    }

    public enum PersistanceMode {SqLite, Xml}
}
